
import request from './request'

// import request from './index'
/**
 * 
 * @param {我的评论} params 
 */
function getEvaluate(params) {
    let { accountId, pageNum, pageSize } = params
    let data = { accountId, pageNum, pageSize }
    return request({
        url: '/community/evaluate',
        method: 'get',
        params: data
    })
}
/**
 * 
 * @param {新增评论} params 
 */
function postEvaluate(params) {
    let { content, evaluateTo, accountId } = params
    let data = { content, evaluateTo, accountId }
    return request({
        url: '/community/evaluate',
        method: 'Post',
        data
    })
}
/**
 * 
 * @param {删除评论} params 
 */
function deleteEvaluate(params) {
    console.log(params)
    let { id } = params
    return request({
        url: '/community/evaluate?id=' + id,
        method: 'delete',
    })
}
/**
 * 
 * @param {查询帖子下所有的评论及回复} params 
 */
function getEvaluatelist(params) {
    let { postId, pageNum, pageSize } = params
    let data = { postId, pageNum, pageSize }
    return request({
        url: '/community/evaluate/evaluates',
        method: 'get',
        params: data
    })
}

export {
    getEvaluate,
    postEvaluate,
    deleteEvaluate,
    getEvaluatelist
}